<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt'%>
<%@ taglib prefix='kjb' uri="/common-fun" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录</title>
<link href="http://www.kaijingbao.com/css/user.css?v=@version@" rel="stylesheet" type="text/css" />
</head>
<body class="NoTop">
<div class="box1000 logo">
<a href="http://www.kaijingbao.com" target="_blank"><img src="http://www.kaijingbao.com/images/user/logo.jpg" width="195" height="85" alt="凯晶堡商城" /></a> </div>
<div class="loginBox">
  <div class="login"  >
    <h3><b>用户登录<span>还没凯晶堡账号？</span></b><a href="<c:url value="/user/registe" />" >立即注册</a></h3>
    <form id="login" action="<c:url value="/user/login" />" method="post">
    <input type="hidden" name="redirectUrl" value="${ param.redirectUrl }">
	    <ul>
	      <li>
	        <label>登录名：</label>
	        <div class="wh2">
	          <input type="text" name="name" class="required" placeholder="用户名/邮箱"/>
	        </div>
	      </li>
	      <li>
	        <label>密&nbsp;&nbsp;码：</label>
	        <div class="wh2">
	          <input type="password" name="password" class="required"/>
	        </div>
	        <a href="<c:url value="/user/forget-password" />" target="_blank">忘记密码？</a> </li>
	      <li class="left65">
	        <input type="checkbox" class="noborder" name="remenber" value="true"/>
	        <span>记住我，下次自动登录</span></li>
	      <li class="left65" >
	        <input type="submit" class="btn btn1"  value="登  录"/>
	        <span id="error" ></span> </li>
	    </ul>
    </form>
    <div class="clearBoth fl extra">
      <h4>您可以使用合作网站直接登录：</h4>
      <div>
      <a href="javascript:window.open('<c:url value="/open-user/login?type=${ kjb:getEntityEnumValue(\"OpenUser$OpenUserType\",\"QQ\") }" />','oathu_login','width=530,height=450');"   class="qq">腾讯</a>
      <a href="javascript:window.open('<c:url value="/open-user/login?type=${ kjb:getEntityEnumValue(\"OpenUser$OpenUserType\",\"SINA\") }" />','oathu_login','width=530,height=450');" class="sina">新浪</a>
      <a href="javascript:window.open('<c:url value="/open-user/login?type=${ kjb:getEntityEnumValue(\"OpenUser$OpenUserType\",\"BAIDU\") }" />','oathu_login','width=530,height=450');" class="baidu">百度</a>
     </div>
    </div>
  </div>
</div>
<div class="clear"></div>
<!--#include virtual="/html/include/userFooter.html"-->
<!--#include virtual="/html/include/js.html"-->
<script type="text/javascript">
	var redirectUrl = $("[name='redirectUrl']").val();
	if (!redirectUrl) {
		redirectUrl = "http://www.kaijingbao.com/user/index";
	}
	if('${user}'){
		window.location.href = redirectUrl;
	}

	$("#login").validate({
		  errorPlacement: function(error, element) {
			  $('#error').addClass('loginError').text( error.text());
		  },
		  submitHandler: function(form) {
			  $('input[type=submit]', $(form)).attr('disabled' , true ).val('登录中...');
			kjb.ajax({
				form:$(form),
				success:function(){
					window.location.href = redirectUrl;
				},
				error:function(data){
					$('#error').addClass('loginError').text(data.message);
					$('input[type=submit]', $(form)).attr('disabled' , false ).val('登  录');
				}
			});
		  }
	});
</script>	

</body>
</html>